aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/nav/breadcrumb.stories.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-04-11 22:56:43 +0200
committerArmand Philippot <git@armandphilippot.com>2022-04-11 22:56:43 +0200
commit714273556f5278746a4022d0e87153ff431a61cf (patch)
treed87f8df0d04abb66acba1079b0d55732ae5d3f8f /src/components/molecules/nav/breadcrumb.stories.tsx
parent62f06c40a4eac6d11f1a93f3b49dfe6c48ce16f8 (diff)
chore: add a Breadcrumb component
Diffstat (limited to 'src/components/molecules/nav/breadcrumb.stories.tsx')
-rw-r--r--src/components/molecules/nav/breadcrumb.stories.tsx48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/components/molecules/nav/breadcrumb.stories.tsx b/src/components/molecules/nav/breadcrumb.stories.tsx
new file mode 100644
index 0000000..d283619
--- /dev/null
+++ b/src/components/molecules/nav/breadcrumb.stories.tsx
@@ -0,0 +1,48 @@
+import { ComponentMeta, ComponentStory } from '@storybook/react';
+import { IntlProvider } from 'react-intl';
+import BreadcrumbComponent, { type BreadcrumbItem } from './breadcrumb';
+
+export default {
+ title: 'Molecules/Nav',
+ component: BreadcrumbComponent,
+ argTypes: {
+ className: {
+ control: {
+ type: 'text',
+ },
+ table: {
+ category: 'Styles',
+ },
+ description: 'Set additional classnames to the nav element.',
+ type: {
+ name: 'string',
+ required: false,
+ },
+ },
+ items: {
+ description: 'The breadcrumb items.',
+ type: {
+ name: 'object',
+ required: true,
+ value: {},
+ },
+ },
+ },
+} as ComponentMeta<typeof BreadcrumbComponent>;
+
+const Template: ComponentStory<typeof BreadcrumbComponent> = (args) => (
+ <IntlProvider locale="en">
+ <BreadcrumbComponent {...args} />
+ </IntlProvider>
+);
+
+const items: BreadcrumbItem[] = [
+ { id: 'home', url: '#', name: 'Home' },
+ { id: 'blog', url: '#', name: 'Blog' },
+ { id: 'post1', url: '#', name: 'A Post' },
+];
+
+export const Breadcrumb = Template.bind({});
+Breadcrumb.args = {
+ items,
+};