mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 20:33:02 +00:00
docs(tabs): add auto width example
This commit is contained in:
parent
924deee6f6
commit
4cfa2a1c39
1 changed files with 17 additions and 0 deletions
|
@ -20,6 +20,23 @@ components: ["Tabs", "Tab", "TabContent", "TabsSkeleton"]
|
||||||
</div>
|
</div>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
|
### Auto width
|
||||||
|
|
||||||
|
By default, the width of each tab is set to `10rem`.
|
||||||
|
|
||||||
|
Set `autoWidth` to `true` for tabs to have an automatically set width.
|
||||||
|
|
||||||
|
<Tabs autoWidth>
|
||||||
|
<Tab label="Tab label 1" />
|
||||||
|
<Tab label="Tab label 2" />
|
||||||
|
<Tab label="Tab label 3" />
|
||||||
|
<div slot="content">
|
||||||
|
<TabContent>Content 1</TabContent>
|
||||||
|
<TabContent>Content 2</TabContent>
|
||||||
|
<TabContent>Content 3</TabContent>
|
||||||
|
</div>
|
||||||
|
</Tabs>
|
||||||
|
|
||||||
### Reactive example
|
### Reactive example
|
||||||
|
|
||||||
<FileSource src="/framed/Tabs/TabsReactive" />
|
<FileSource src="/framed/Tabs/TabsReactive" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue