Skip to main content

📄 Biblo Items

Note

The named exports must be of the type BibloItem.

Props​

PropertyTypeRequiredDescription
titlestring❌The title of the state of your component, that you want to show off.
descriptionstring❌A description.
props{}❌An object defining a set of props to apply to your component.
wrapperReact.ElementType❌Sometimes it's helpful to have your component wrapped in another component.
wrapperStyleStyleProp<ViewStyle>❌Sometimes it's helpful to just add some styling to the View (or another component) that your component is being wrapped inside.

Examples​

🌱 Simplest​

This is the simplest way to export an example of your component.

Separator.biblo.tsx
const Template: BibloItem<SeparatorProps> = (props) => <Separator {...props} />;

export const Default = Template.bind({});

The title of the example will be Default and it will have no description, no props, no wrapper, no nothing.

🌿 Still simple​

Here we'll give it a bit more something something.

Separator.biblo.tsx
const Template: BibloItem<SeparatorProps> = (props) => <Separator {...props} />;

export const Vertical = Template.bind({});
Vertical.title = "A vertical separator";
Vertical.description = "This is the Separator component in its vertical state.";
Vertical.props = {
vertical: true,
};
Vertical.wrapperStyle = {
padding: 10,
};

🌴 Advanced​

In case you need to use hooks or some other JavaScript logic - here's how you do it:

Separator.biblo.tsx
export const BrandColored: BibloItem<SeparatorProps> = (props) => {
const { palette } = useTheme();
return <Separator {...props} color={palette.brandColor} />;
};
BrandColored.title = "Colored (brand)";
BrandColored.description = "This is the Separator component in our brand color.";
BrandColored.props = {
margin: true,
style: "dashed",
};
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>