-
-
Notifications
You must be signed in to change notification settings - Fork 180
Expand file tree
/
Copy pathBackgroundCsf.stories.tsx
More file actions
49 lines (43 loc) · 1.24 KB
/
BackgroundCsf.stories.tsx
File metadata and controls
49 lines (43 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import type { StoryObj, Meta } from '@storybook/react-native';
import { Text, StyleSheet } from 'react-native';
const Background = () => (
<Text style={styles.text}>Change background color via Addons -> Background</Text>
);
const styles = StyleSheet.create({
text: { color: 'black' },
});
const meta = {
component: Background,
tags: ['backgrounds'],
// parameters: {
// backgrounds: {
// default: 'warm',
// values: [
// { name: 'warm', value: 'hotpink' },
// { name: 'cool', value: 'deepskyblue' },
// { name: 'white', value: 'white' },
// { name: 'black', value: 'black' },
// ],
// },
// },
parameters: {
backgrounds: {
options: {
// 👇 Override the default `dark` option
warm: { name: 'Warm', value: 'hotpink' },
// 👇 Add a new option
cool: { name: 'Cool', value: 'deepskyblue' },
white: { name: 'White', value: 'white' },
black: { name: 'Black', value: 'black' },
},
},
},
} satisfies Meta<typeof Background>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Basic: Story = {
globals: {
// 👇 Override background value for this story
backgrounds: { value: 'warm' },
},
};