Search documentation v0.8.1

Setting Card

Display setting options with a title and optional subtitle

Source ↗️ Report Issue ↗️

Use the SettingCard component to present configuration options in cards labeled with titles and optional subtitles:

Preview
Security emails
Get security alerts for logins.
Marketing emails
Get email about updates.
How to use the SettingCard component in Astro
<div class="flex column sm">
<SettingCard
title="Security emails"
subTitle="Get security alerts for logins."
>
<Switch toggled={true} />
</SettingCard>
<SettingCard
title="Marketing emails"
subTitle="Get email about updates."
>
<Switch />
</SettingCard>
</div>

If you have your utility styles enabled, you can use the above classes to align multiple SettingCard components under each other with a small gap. Each SettingCard component can have a title and subTitle prop. To create the input, simply pass your components as the child for the SettingCard:

Card with Checkbox
Security emails
Get security alerts for logins.
Card with Button
Security emails
Get security alerts for logins.
---
import { Checkbox } from 'webcoreui/astro'
---
<SettingCard
title="Security emails"
subTitle="Get security alerts for logins."
>
<Checkbox />
</SettingCard>
---
import { Button } from 'webcoreui/astro'
---
<SettingCard
title="Security emails"
subTitle="Get security alerts for logins."
>
<Button>Toggle</Button>
</SettingCard>

You can use the following components in Webcore in combination with the SettingCard component to build different kinds of settings:

Click on the component name to navigate to their docs.

API

type SettingCardProps = {
title: string
subTitle?: string
}
PropPurpose
title Sets the title for the setting card.
items Sets an optional secondary title for the setting card.

Request improvement for this page