🏷️ Biblo Bio
Note
The default export must be of the type BibloBio
.
This is where you define all the basic information for your component.
Props
Property | Type | Required | Description |
---|---|---|---|
component | React.ElementType | ✅ | The component you want to showcase. |
title | string | ✅ | The name or title of your component. |
subtitle | string | ❌ | A short description that will also be visible in the list of components. |
description | string | ❌ | A longer description. |
tags | string[] | ❌ | An array of tags. E.g. ["interactive", "button"] |
searchTerms | string[] | ❌ | An array of strings that the search will match up against. |
section | string | ❌ | The name of the section. This will take precedence over any other logic to find out which section a component belongs in. |
props | {} | ❌ | An object defining a default set of props to apply to your component. |
wrapper | React.ElementType | ❌ | Sometimes it's helpful to have your component wrapped in another component. |
wrapperStyle | StyleProp<ViewStyle> | ❌ | Sometimes it's helpful to just add some styling to the View (or another component) that your component is being wrapped inside. |
Example
- TypeScript
- JavaScript
Separator.biblo.tsx
import { BibloBio, BibloItem } from "@biblo/react-native";
import { Separator, SeparatorProps } from "./Separator";
import { MyWrapper } from "../MyWrapper";
export default {
title: "Separator",
subtitle: "A line",
description: "A line separating two different types of content.",
tags: ["graphics"],
searchTerms: ["divider", "hr", "horizontal rule"],
section: "Atoms",
props: {
style: "dashed",
},
wrapper: MyWrapper,
wrapperStyle: {
padding: 10,
},
} as BibloBio<SeparatorProps>;
tip
If you can't or don't want to import an interface or type definition for the props of a component, use this instead:
type SeparatorProps = React.ComponentProps<typeof Separator>
Separator.biblo.jsx
import { Separator } from "./Separator";
import { MyWrapper } from "../MyWrapper";
export default {
title: "Separator",
subtitle: "A line",
description: "A line separating two different types of content.",
tags: ["graphics"],
searchTerms: ["divider", "hr", "horizontal rule"],
section: "Atoms",
props: {
style: "dashed",
},
wrapper: MyWrapper,
wrapperStyle: {
padding: 10,
},
};