Components
- Accordion
- Action BarUpdated
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- BadgeUpdated
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- CalendarUpdated
- CardUpdated
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context MenuUpdated
- Data List
- Date Picker
- DialogUpdated
- DrawerUpdated
- Editable
- FieldUpdated
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- MarqueeUpdated
- Menu
- Native Select
- Number InputUpdated
- Pagination
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- TableUpdated
- Tabs
- Textarea
- TimerUpdated
- ToastUpdated
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Hooks
Hello, World! This is a sample text file.
Installation#
pnpm dlx shadcn@latest add @shark/download-trigger
Usage#
import { DownloadTrigger } from "@/registry/react/components/download-trigger";
<DownloadTrigger data="..." fileName="schema.json" mimeType="application/json" > Download </DownloadTrigger>
Examples#
Download SVG#
Download an SVG file by passing the SVG markup to data and setting mimeType to image/svg+xml.
Promise#
Trigger downloads from a promise that returns a Blob, File, or string. Pass a function to data.
API Reference#
DownloadTrigger#
| Prop | Type | Default |
|---|---|---|
data | DownloadableData | (() => MaybePromise<DownloadableData>) | - |
fileName | string | - |
mimeType | FileMimeType | - |
asChild | boolean | - |
For a complete list of props, see the Ark UI documentation.