common
Table
Display data efficiently in a column and row format.
A Peer-to-Peer Electronic Cash System. Launched in January 3rd 2009 by Satoshi Nakamoto.
On May 22, 2010, a programmer named Laszlo Hanyecz made history by spending 10,000 Bitcoins to have two Papa John's pizzas delivered to his door.
Installation
Install dependencies
bash
npm install tailwind-variants radix-vue
Add component
Copy and paste the code into your project's component directory.
Usage notes
In order to accept a template for each trigger and content, we use vue slots
.
For the triggers, name them trigger{number}
, and for the contents, name them content{number}
:
vue
<Tabs>
<template #trigger1>
<span>Trigger</span>
</template>
<template #trigger2>
<span>Trigger 2</span>
</template>
<template #content1>
<span>Content 1</span>
</template>
<template #content2>
<span>Content 2</span>
</template>
</Tabs>
Inside the template
tag, you can put whatever you want.
Make sure you create the same number of trigger
and content
slots.
To define a open item by default, use the defaultValue
prop with tab{number}
as the value:
vue
<Accordion defaultValue="tab1">
...
</Accordion>