Skip to content

Commit

Permalink
RSP nested tabs story (#6756)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktabors authored Jul 26, 2024
1 parent 32d4c0e commit 14f324f
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions packages/@react-spectrum/tabs/stories/Tabs.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,55 @@ Links.story = {
}
};

export const Nested = (props) => {
return (
<Tabs aria-label="Some tabs" width={'500px'} {...props} >
<TabList>
<Item key="one">Tab 1</Item>
<Item key="two">Tab 2</Item>
<Item key="three">Tab 3</Item>
<Item key="four">Tab 4</Item>
<Item key="five">Tab 5</Item>
</TabList>
<TabPanels>
<Item key="one">
<Heading>Nested</Heading>
<Tabs {...props}>
<TabList>
<Item>Tab 1</Item>
<Item>Tab 2</Item>
</TabList>
<TabPanels>
<Item>
<TextField label="Tab 1" />
</Item>
<Item>
<TextField label="Tab 2" />
</Item>
</TabPanels>
</Tabs>
</Item>
<Item key="two">
<Heading>Bar</Heading>
<Text>To bar or not to bar.</Text>
</Item>
<Item key="three">
<Heading>Foobar</Heading>
<Text>That is the foobar.</Text>
</Item>
<Item key="four">
<Heading>Foofoo</Heading>
<Text>Once more foo upon the foo.</Text>
</Item>
<Item key="five">
<Heading>Barfoo</Heading>
<Text>What's he that barfoos so?</Text>
</Item>
</TabPanels>
</Tabs>
);
};

function render(props = {}) {
return (
<Tabs
Expand Down

1 comment on commit 14f324f

@rspbot
Copy link

@rspbot rspbot commented on 14f324f Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.