-
Notifications
You must be signed in to change notification settings - Fork 25
Documentation Styleguide
Ryan Johnson edited this page May 3, 2018
·
4 revisions
Documentation should guide a consumer through the steps needed to implement a component in their application. The ideal path should navigate through documentation that increases in complexity, so that the simplest path is reached as early as possible.
A consumer should be able to copy and paste a snippet into their own application with little to no modification.
RECOMMEND
- Short, focused snippets
- Use native HTML elements
- Use HelixUI-defined elements
- Use HelixUI-defined class names
- Function placeholders, with instruction to define in consumer's application
AVOID
- Avoid long, complex snippets
- Avoid using assets defined in a 3rd party library.
- e.g., Bootstrap class names
- Function placeholders without further instruction
A component is a collection of elements that contribute to a larger set of behaviors.
RECOMMEND
- Static examples of the component in various states
- Interactive demos (optional)
- Cross-link between related components to aid discovery.
- e.g., from Grid to Layout (and vice versa)
- Cross-link to elements used in a component
- e.g., from Tabs to
<hx-tabset>
- e.g., from Tabs to
AVOID
- Do not cross-link to unrelated elements
- e.g., from
Icons
to<hx-tabset>
- e.g., from
- Do not cross-link to unrelated components
- e.g., from
Icons
toGrid
- e.g., from
An element is an isolated unit that is often used in combination with other elements to provide more complex behavior.
RECOMMEND
- Document element metadata (parents, children, events, etc.)
- Document element attributes
- Document element properties
- Every attribute should have an associated property.
- Cross-link between related elements
- e.g., from
<hx-tabset>
to<hx-tablist>
- e.g., from
- Cross-link to components the element helps compose.
- e.g., from
<hx-tabset>
toTabs
- e.g., from
AVOID
- No interactive examples
- No empty elements
- Do not define or document elements lacking behavior.
- Do not reflect every property as an attribute.
- Not every property can be configured via attributes.
- Do not cross-link between unrelated elements
- e.g., from
<hx-tabset>
to<hx-tooltip>
- e.g., from
- Do not cross-link to unrelated components
- e.g., from
<hx-tabset>
toBox
- e.g., from