🚀 Ship faster with premium components 🚀
Search documentation v1.4.0

Setting Card

Display setting options with a title and optional subtitle

How to add this block to your project
npm create webcore@latest add SettingCard

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.

Additional Content

You can also add any additional content to the SettingCard component, like icons, labels, and other elements using the additional-content slot:

Card with additional content
Notifications
Get email notifications on user activity
<SettingCard
title="Notifications"
subTitle="Get email notifications on user activity"
>
<Checkbox label="Toggle all" />
<div slot="additional-content" class="flex column sm">
<Switch label="Marketing" small={true} />
<Switch label="Promotional" small={true} />
<Switch label="Social" small={true} />
</div>
</SettingCard>

API

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