Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@chakra-ui/vue components documentation #69

Merged
merged 138 commits into from May 5, 2020
Merged

@chakra-ui/vue components documentation #69

merged 138 commits into from May 5, 2020

Conversation

codebender828
Copy link
Collaborator

@codebender828 codebender828 commented Mar 21, 2020

@chakra-ui/vue components documentation

Deploy Preview -> https://chakra-ui-vue.now.sh

GUIDELINES

I thought to include this guideline for how to write the component docs.

Props &. Events

You might be referencing the docs for React while writing these. But we must be extremely cautious that we write them knowing that the end user is going to be a Vue.js user. And Vue has fairly different patterns. In React, the entire component API is handled via props. But in Vue we have both props and events.

When browsing the docs in Chakra-ui you will find a few components with a prop called onChange or onSubmit. These should be changed to @change and @submit events in the Vue docs to avoid confusion. These types of props doesn't exist on the @chakra-ui/vue components except 1 or 2 of them.

So this means you need to create two kinds of tables. One for Props, and another for Events.

The Props table will document the usual props. The Events table will document the events emitted by a component.

In summary:

  • Use Props table to document props for a component
  • Use Events table to document events for a component

Live code samples.

Again, to make the consumption of these components as consumer friendly as possible, we need to provide the code examples is a pattern that is familiar with all Vue developers. Every Vue dev is familiar with the concept of Vue Single File Components. It's made up of the template and script as well.

Static template examples
For simple examples that do not require any data from the script we can just directly render the components. See the badge example taken from here:

<c-badge variant="outline">Updated</c-badge>

Dynamic template state
Examples that require reactive state from the <template> should be accompanied with the <script />. So all such exmaples should adopt the structure of:

<template>
  <!--
    Live code example goes here
  -->
</template>

<script>
export default {
  // Provide reactive data if needed
  data () {
    return {}
  }
}
</script>

In summary:

  • For examples that have no reactive state, just directly paste snippet. (See examples in button, checkbox, etc)
  • For examples that use reactive state. Include both the and the <script>. (See examples on alertdialog) docs.

    STATUTORIES

    • Getting Started
    • Principles
    • Style Props
    • Color Mode
    • Theme
    • Recipes

    COMPONENTS

    • Accordion
    • Accordion
    • Alert
    • AlertDialog
    • AspectRatioBox
    • Avatar
    • Badge
    • Box
    • Breadcrumb
    • Button
    • Checkbox
    • CircularProgress
    • CloseButton
    • Code
    • Collapse
    • ControlBox
    • Divider
    • Drawer
    • Editable
    • Flex
    • FormControl
    • Grid
    • Heading
    • Icon
    • IconButton
    • Image
    • Input
    • Link
    • List
    • Menu
    • Modal
    • NumberInput
    • Popover
    • Progress
    • PseudoBox
    • Radio
    • SimpleGrid
    • Select
    • Slider
    • Spinner
    • Stat
    • Stack
    • Switch
    • Tabs
    • Tag
    • Text
    • Textarea
    • Toast
    • Tooltip

@codebender828 codebender828 changed the title @chakra-ui/vue components documentation [WIP]: @chakra-ui/vue components documentation Mar 21, 2020
@DominusKelvin
Copy link
Contributor

Looks all good.

@codebender828 codebender828 self-assigned this Mar 25, 2020
@codebender828 codebender828 added status: work in progress 🐜 Someone is working on this type: documentation 📚 Improvements or additions to documentation labels Mar 25, 2020
Added docs for Button component
docs: documentation for Alert component
@DominusKelvin
Copy link
Contributor

DominusKelvin commented Mar 26, 2020

Okay, I got that. I would update as per the guidelines.

@vercel vercel bot requested a deployment to Preview May 4, 2020 16:45 Abandoned
@vercel vercel bot requested a deployment to Preview May 4, 2020 16:45 Abandoned
@vercel vercel bot requested a deployment to Preview May 4, 2020 16:45 Abandoned
@vercel vercel bot requested a deployment to Preview May 4, 2020 16:46 Abandoned
@vercel vercel bot requested a deployment to Preview May 4, 2020 16:58 Abandoned
@vercel
Copy link

vercel bot commented May 4, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/chakra-ui/chakra-ui-vue/kgvnhr01m
✅ Preview: https://chakra-ui-vue-git-dev-docs.chakra-ui.now.sh

@vercel vercel bot requested a deployment to Preview May 5, 2020 19:25 Abandoned
@vercel vercel bot temporarily deployed to Preview May 5, 2020 19:34 Inactive
@vercel vercel bot requested a deployment to Preview May 5, 2020 19:34 Abandoned
@vercel vercel bot requested a deployment to Preview May 5, 2020 19:35 Abandoned
@codebender828 codebender828 marked this pull request as ready for review May 5, 2020 19:35
@codebender828 codebender828 changed the title [WIP]: @chakra-ui/vue components documentation @chakra-ui/vue components documentation May 5, 2020
@codebender828 codebender828 removed the status: work in progress 🐜 Someone is working on this label May 5, 2020
@codebender828 codebender828 merged commit 3c9785e into master May 5, 2020
@vercel vercel bot requested a deployment to Preview May 5, 2020 19:55 Abandoned
@codebender828 codebender828 deleted the dev/docs branch May 9, 2020 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation 📚 Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation Site [Ongoing]
2 participants