Octri

docs components

Lists your custom components: the ones your MDX pages use as tags, such as <Banner>. push creates or updates by name, so a components folder kept in a repository can be pushed on every commit. See custom components.

bash
octri docs components [list | built-in | show <name> | push <file> | remove <name> --yes]

octri docs components built-in

Lists the built-in components, such as Callout and CardGroup. A custom component can't take one of their names.

octri docs components show <name|id>

Prints one component's source, styles and props.

Arguments

<name|id>stringrequired

The component's name or ID.

octri docs components push <file>

Creates the component, or updates the one with the same name. A .mdx file makes an MDX component. Anything else is the markup of a visual component: one root element, HTML attribute names such as class, props written as {name}, and no imports, exports or functions.

Arguments

<file>pathrequired

A .jsx or .mdx file.

Flags

--name <Name>stringdefault: from the file name

The tag name. banner.jsx becomes Banner and call-out.mdx becomes CallOut.

--css <file>path

A stylesheet scoped to the component.

--props <props.json>path

The props it takes, as JSON.

--description <text>string

What it's for, shown in API Studio.

octri docs components remove <name|id> --yes

Deletes a component. Pages that use it stop rendering it, so it needs --yes.

Arguments

<name|id>stringrequired

The component's name or ID.

Flags

--yesbooleanrequired

Confirms the delete.

Examples

List built-in components

bash
octri docs components built-in
Output
✔ Loading built-in components

Built-in components (27)
  Accordion, AccordionGroup, AccordionItem, Badge, Banner, Button, Callout, Card, CardGroup, Check, CodeGroup, FileTree, Frame, Icon, Image, Info, Note, ParamField, ResponseField, Step, Steps, Tab, Tabs, Tip, Tooltip, Video, Warning
  A custom component cannot take one of these names.

Push a folder of components

bash
for file in components/*.jsx; do octri docs components push "$file"; done