Skip to content
portalbits
Home Docs GitHub(opens in a new tab)

Guides

Get startedFoundationsMotion

Components

All components

Buttons

ButtonIconButton

Inputs

InputSelectTextareaSlider

Selection

CheckboxToggleToggleGroupSwitchRadioGroup

Identity

AvatarBadge

Overlays

DialogPopoverTooltipDropdownMenuAlertDialog

Disclosure

TabsAccordion

Cards

AppCardArticleCardFeatureCard

Content

CarouselSectionHeaderEmptyStateAlertProgressSeparatorRowListRow

Chrome

PortalShellSidebarNavMobileNavTopBarAuthFrameColorSelectorFloatingNav

FeatureCard

A feature with media, a heading, and a short description.

Colorful geometric illustration

Room to explore

Give each direction the space it needs to grow.

Variations
More examples

Three features in a grid

Colorful geometric illustration

Start with a spark

Collect the little ideas worth returning to.

Colorful geometric illustration

Room to explore

Give each direction the space it needs to grow.

Colorful geometric illustration

Bring it together

Turn a few good pieces into something you can share.

Source

<script lang="ts">
  import 'portal-bits/styles.css';
  import 'portal-bits/tokens.css';
  import type { Snippet } from 'svelte';

  let { children }: { children: Snippet } = $props();
</script>

{@render children()}
<script lang="ts">
  import FeatureCardExample from './FeatureCardExample.svelte';
</script>

<FeatureCardExample media={"image"} />
<script lang="ts">
  import { FeatureCard } from 'portal-bits';
  let { media = 'image' }: { media?: 'image' | 'fallback' } = $props();

  // A synthetic poster as inline SVG data. Pass your own image URL as `image` instead.
  const poster = `data:image/svg+xml,${encodeURIComponent(
    '<svg xmlns="http://www.w3.org/2000/svg" width="640" height="400" viewBox="0 0 640 400"><rect width="640" height="400" fill="#d8ec86"/><circle cx="440" cy="30" r="135" fill="none" stroke="#244a31" stroke-width="38" opacity=".22"/><circle cx="440" cy="310" r="135" fill="none" stroke="#244a31" stroke-width="38" opacity=".22"/><text x="32" y="178" fill="#244a31" font-family="Arial,sans-serif" font-size="66" font-weight="500">common</text></svg>',
  )}`;
</script>

<div class="narrow">
  <FeatureCard
    title="Room to explore"
    description="Give each direction the space it needs to grow."
    image={media === 'image' ? poster : undefined}
    imageAlt={media === 'image' ? 'Colorful geometric illustration' : ''}
  />
</div>

<style>
  .narrow {
    max-width: 360px;
  }
</style>

API reference

These tables list the props and snippets that FeatureCard declares. Attributes passed through to an element or primitive are listed under Forwarded attributes, not here.

Props

NameTypeDefaultRequiredBindingDescription
titlestringNoneYesOne-wayThe heading.
descriptionstringNoneYesOne-wayThe supporting text.
imagestringNoneNoOne-wayThe media URL. A failed load keeps the media region with a placeholder.
imageAltstring""NoOne-wayAlt text for the media. Empty marks it decorative.
headingLevel2 | 3 | 43NoOne-wayThe heading level of the title.

Forwarded attributes

None. FeatureCard forwards no attributes.

No data attributes are documented as stable.

Limits

  • Not a control. It has no link, button, or selection state.
  • The 4:3 media ratio, the inner radius, and the placeholder art are adaptations.

Related

  • ArticleCard
  • Carousel
Previous ArticleCard Next Carousel

On this page

  • Preview
  • Source
  • API reference
  • Props
  • Forwarded attributes
  • Limits