Available on npm · 0.20.0

Ant Design–style components for Svelte 5

An independent implementation built with runes and snippets. Typed, accessible, with design tokens and a dark theme.

npm install svelte-ant-design

Why svelte-ant-design

A familiar look and API, a native Svelte 5 implementation.

Written for Svelte 5

Runes, snippets and callbacks instead of wrappers around React or Vue.

TypeScript

Strict prop types, exported alongside the components.

Accessibility is tested

Native elements and focus handling are checked in a real browser; the accessible colours keep a text contrast of at least 4.5:1.

Design tokens and dark theme

CSS variables with the --ads- prefix. The dark theme is switched by one attribute.

Tested at three levels

Unit tests, Playwright in a browser and mutation testing.

Few dependencies

Svelte 5 as the peer dependency and four runtime packages (MIT), each used in one place. A small package.

Quick start

Install the package, import the tokens once and use the component.

App.svelte
<script lang="ts">
  import 'svelte-ant-design/tokens.css';
  import { Button } from 'svelte-ant-design';
</script>

<Button type="primary" onclick={() => console.log('saved')}>
  Save
</Button>
<Button danger>Delete</Button>
Result

Roadmap

Components are added one by one. Each one ships with tests and a documentation page.

Now Ready

Button

typesizeshapeloadingdangerghosthref

Typography

typecopyableeditableellipsislevelshimmerclassNames

Icon

iconspinrotatetwoToneColorlabelcomponentcreateFromIconfontCN

Grid

gutterspanoffsetorderflexjustifyxsBreakpoints

Space

sizeorientationalignwrapseparatorSpaceCompactSpaceAddon

Menu

itemsmodethemeselectedKeysopenKeysinlineCollapsedmultipleclassNames

Dropdown

menutriggerplacementarrowpopupRenderopenclassNames

Input

valuevariantstatusallowClearshowCountprefixclassNamesstyles

Checkbox

checkedindeterminatedisabledvalueoptionsclassNamesstyles

Radio

valueoptionsoptionTypebuttonStylesizeorientationblockclassNames

Switch

checkedonchangesizeloadingdisabledclassNamesstyles

Select

valuemodeoptionsshowSearchallowClearmaxTagCountclassNames

DatePicker

pickershowTimemultiplepresetsdisabledDatelocaleDateRangePicker

TimePicker

formatuse12HoursminuteStepdisabledTimechangeOnScrolllocaleTimeRangePicker

Form

nameruleslayoutlabelColvalidateTriggerhasFeedbackdependenciesscrollToFirstError

Tooltip

titleplacementtriggerarrowcoloropenclassNames

Spin

spinningdelaysizedescriptionpercentfullscreenclassNames

Modal

opentitlefootercloseOnOkmaskcenteredwidthfocusablemodal.confirm

Drawer

openplacementsizeextramaskpushresizablecontainerclassNames

Message

opentypedurationkeyclosablestackclassNames

Notification

titledescriptionplacementdurationkeyactionsstackshowProgress

Next Planned

The base for forms and text.

Later Planned

More complex components.

Table