Skip to content

Commit 75abd25

Browse files
authored
feat: add component Segmented
1 parent cd1ddcd commit 75abd25

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

src/Segmented/index.stories.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { StoryFn } from '@storybook/react-webpack5';
2+
import React from 'react';
3+
4+
import { Segmented, SegmentedProps } from './index';
5+
6+
export default {
7+
title: 'Segmented',
8+
component: Segmented,
9+
};
10+
11+
export const Default: StoryFn<SegmentedProps> = function Default(args) {
12+
return (
13+
<Segmented options={['Segment A', 'Segment B', 'Segment C']} {...args} />
14+
);
15+
};

src/Segmented/index.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import {
2+
Segmented as AntdSegmented,
3+
SegmentedProps as AntdSegmentedProps,
4+
} from 'antd';
5+
import {
6+
SegmentedValue as AntdSegmentedValue,
7+
SegmentedLabeledOption as AntdSegmentedLabeledOption,
8+
} from 'antd/es/segmented';
9+
10+
export type SegmentedValue = AntdSegmentedValue;
11+
export type SegmentedLabeledOption = AntdSegmentedLabeledOption;
12+
13+
export type SegmentedProps = AntdSegmentedProps;
14+
export const Segmented = AntdSegmented;

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export * from './Progress';
4343
export * from './Radio';
4444
export * from './RangeWithValue';
4545
export * from './Result';
46+
export * from './Segmented';
4647
export * from './Select';
4748
export * from './Skeleton';
4849
export * from './Slider';

0 commit comments

Comments
 (0)