Choice Card
Rozbudowane karty radiowe, w których cała karta jest opcją, z jednym przystankiem tabulatora i nawigacją strzałkami.
Dostępny w
Angular: dostępny Vue: dostępny React: dostępny React Native: dostępny
Użycie
<div class="demo-stack" style="max-width: 36rem">
<div soneChoiceGroup aria-label="Plan"
style="display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--space-2)">
<button soneChoiceCard type="button" [selected]="plan() === 'free'" (click)="plan.set('free')">
<span soneChoiceCardTitle>Free</span>
<span soneChoiceCardDescription>Up to 3 projects.</span>
<span soneChoiceCardIndicator></span>
</button>
<button soneChoiceCard type="button" [selected]="plan() === 'team'" (click)="plan.set('team')">
<span soneChoiceCardTitle>Team</span>
<span soneChoiceCardDescription>Unlimited projects and shared spaces.</span>
<span soneChoiceCardIndicator></span>
</button>
<button soneChoiceCard type="button" disabled>
<span soneChoiceCardTitle>Enterprise</span>
<span soneChoiceCardDescription>Contact sales to enable.</span>
<span soneChoiceCardIndicator></span>
</button>
</div>
<button soneChoiceCard type="button" orientation="horizontal" [selected]="reminders()"
(click)="reminders.set(!reminders())">
<span style="display: grid; gap: var(--choice-card-gap)">
<span soneChoiceCardTitle>Email reminders</span>
<span soneChoiceCardDescription>A standalone card toggles on click.</span>
</span>
<span soneChoiceCardIndicator></span>
</button>
</div>Import
import {
SoneChoiceCardDescriptionDirective,
SoneChoiceCardDirective,
SoneChoiceCardIndicatorDirective,
SoneChoiceCardTitleDirective,
SoneChoiceGroupDirective,
} from "@surface-one/angular/choice-card";Dokumentacja API
SoneChoiceCardDescriptionDirectiveDyrektywa
SoneChoiceCardDirectiveDyrektywa
| Nazwa | Typ | Domyślnie |
|---|---|---|
selected | boolean | false |
orientation | "vertical" | "horizontal" | "vertical" |
SoneChoiceCardIndicatorDirectiveDyrektywa
SoneChoiceCardTitleDirectiveDyrektywa
SoneChoiceGroupDirectiveDyrektywa
| Nazwa | Typ | Domyślnie |
|---|---|---|
orientation | "vertical" | "horizontal" | null | null |