-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(ffe-chart-donut-react): storybook example
- Loading branch information
Peter Hellstrand
committed
Sep 11, 2024
1 parent
9e7c6de
commit 820b0b1
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
import { ChartDonut } from './ChartDonut'; | ||
import type { StoryObj, Meta } from '@storybook/react'; | ||
|
||
const meta: Meta<typeof ChartDonut> = { | ||
title: 'components/chart-donut/ChartDonut', | ||
component: ChartDonut, | ||
tags: ['autodocs'], | ||
}; | ||
export default meta; | ||
|
||
type Story = StoryObj<typeof ChartDonut>; | ||
|
||
export const Standard: Story = { | ||
args: { | ||
name: 'Name', | ||
firstLabel: 'First label', | ||
lastLabel: 'Last label', | ||
percentage: 42, | ||
}, | ||
render: args => <ChartDonut {...args} />, | ||
}; | ||
export const Custom: Story = { | ||
args: { | ||
name: 'Name', | ||
percentage: 42, | ||
label: ( | ||
<div | ||
style={{ | ||
marginTop: 10, | ||
textAlign: 'center', | ||
}} | ||
> | ||
Du har selv ansvar | ||
<br /> | ||
<strong>for all styling</strong> | ||
</div> | ||
), | ||
}, | ||
render: args => <ChartDonut {...args} />, | ||
}; |