GitHub

Card

A card is a flexible content container used to group related information and actions about a single subject.

Components

import { DaffCardComponent } from '@daffodil/design/card'

A basic card variant with a filled background.

@Component()
class DaffCardComponent {
  @Input() color: DaffPalette
  @Input() orientation: DaffCardOrientation = DaffCardOrientationEnum.Vertical
  @Input() elevated: boolean = false
}

Inputs

color
DaffPalette
Default –
Description

Sets the color on a component.

Default options are: primary, secondary, tertiary, light, dark, theme, and theme-contrast.

orientation
DaffCardOrientation
DefaultDaffCardOrientationEnum.Vertical
Description

The orientation of a card.

elevated
boolean
Defaultfalse
Description

Whether or not a card displays a shadow.


import { DaffStrokedCardComponent } from '@daffodil/design/card'

A card variant with a stroked (outlined) border instead of a filled background.

@Component()
class DaffStrokedCardComponent {
  @Input() color: DaffPalette
  @Input() orientation: DaffCardOrientation = DaffCardOrientationEnum.Vertical
  @Input() elevated: boolean = false
}

Inputs

color
DaffPalette
Default –
Description

Sets the color on a component.

Default options are: primary, secondary, tertiary, light, dark, theme, and theme-contrast.

orientation
DaffCardOrientation
DefaultDaffCardOrientationEnum.Vertical
Description

The orientation of a card.

elevated
boolean
Defaultfalse
Description

Whether or not a card displays a shadow.


import { DaffRaisedCardComponent } from '@daffodil/design/card'

@Component()
class DaffRaisedCardComponent {
  @Input() color: DaffPalette
  @Input() orientation: DaffCardOrientation = DaffCardOrientationEnum.Vertical
  @Input() elevated: boolean = false
}

Inputs

color
DaffPalette
Default –
Description

Sets the color on a component.

Default options are: primary, secondary, tertiary, light, dark, theme, and theme-contrast.

orientation
DaffCardOrientation
DefaultDaffCardOrientationEnum.Vertical
Description

The orientation of a card.

elevated
boolean
Defaultfalse
Description

Whether or not a card displays a shadow.


Directives

import { DaffCardIconDirective } from '@daffodil/design/card'

Displays a visual or branding element. Avoid using this for interactive or actionable icons.

@Directive()
class DaffCardIconDirective {}

import { DaffCardImageDirective } from '@daffodil/design/card'

Displays an image.

@Directive()
class DaffCardImageDirective {}

import { DaffCardTaglineDirective } from '@daffodil/design/card'

Short, memorable phrase that complements the title and provides quick context.

@Directive()
class DaffCardTaglineDirective {}

import { DaffCardTitleDirective } from '@daffodil/design/card'

The primary heading of the card.

@Directive()
class DaffCardTitleDirective {}

import { DaffCardContentDirective } from '@daffodil/design/card'

A flexible wrapper for text, components, or custom layouts. It's unstyled except for spacing and should only be used once per card.

@Directive()
class DaffCardContentDirective {}

import { DaffCardActionsDirective } from '@daffodil/design/card'

A container for buttons or calls-to-action, always positioned to the bottom of the card.

@Directive()
class DaffCardActionsDirective {}

Modules

import { DaffCardModule } from '@daffodil/design/card'

@NgModule()
class DaffCardModule {}

Types

import { DaffCardOrientation } from '@daffodil/design/card'

The available orientations for a card.

Orientation Description
vertical Stacks card content from top to bottom. This is the default orientation.
horizontal Places card content side-by-side. On smaller screens, horizontal cards automatically switch to vertical for responsiveness.
type DaffCardOrientation = 'vertical' | 'horizontal'

import { DaffCardOrientationEnum } from '@daffodil/design/card'

Enum for representing the available card orientations. See DaffCardOrientation for descriptions of each orientation.

enum DaffCardOrientationEnum {
  Vertical = DaffCardOrientationEnum.Vertical,
  Horizontal = DaffCardOrientationEnum.Horizontal,
}