Phoenix Documentation
Phoenix ProductionPhoenix PreviewContentful
Primary version
Primary version
  • 🔥Phoenix 🔥
  • Installation + Usage
    • Prerequisites
    • Installation
    • Usage
  • Development
    • Architecture
      • Heroku
    • Content Types
      • Action Stats Block
      • Campaign
      • Content Block
      • Cause Page
      • Company Page
      • Current Club Block
      • Current School Block
      • Embed
      • External Link
      • Landing Page
      • Link Action
      • Metadata
      • Page
      • Photo Submission Action
      • Selection Submission Action
      • Share Action
      • Signup Referrals Block
      • Social Drive Action
      • Voter Registration Action
      • Voter Registration Drive Action
      • Voter Registration Marketing Page
      • Voter Registration Referrals Block
    • Features
      • Affiliate Opt In
      • Affiliate Scholarship Block
      • Analytics Waypoint
      • Delayed Element
      • Dismissable Element
      • Stat Card
      • General Buttons
      • Groups
      • Paginated Campaign Gallery
      • Popover Dispatcher
      • Refer A Friend
      • Referrals Gallery
      • Sitewide Banner
      • Sixpack A/B Testing
        • Code Tests
        • Contentful Tests
        • Testing Tips
      • Tooltip
      • Traffic Distribution
      • Volunteer Credits
      • Voter Registration
      • Zendesk Form
    • Contentful
      • Workflow
      • Content Management API Scripts
    • Helpers
  • Phoenix API
    • v2
      • Campaigns Resource
      • Posts Resource
      • Zendesk Endpoint
  • Data + Performance
    • Monitoring
    • Analytics
    • Logging
  • Contributing Instructions
    • Edit This Documentation
    • Glossary
Powered by GitBook
On this page
  1. Development
  2. Features

Stat Card

PreviousDismissable ElementNextGeneral Buttons

Last updated 5 years ago

Stat Card

The StatCard is a UI utility component which renders stat information in a card with a customizable background color.

Usage Instructions

Render the StatCard component with the following props:

  • title: the title of the card, formatted to all caps

  • number: the stat number which gets formatted to a U.S. English locale (comma separated)

  • link: an object containing url & text which gets rendered as an anchor link at the bottom of the card (usually to link to a campaign or article representing the stat)

  • backgroundColor: a css compatible background color which will be assigned as the backgroundColor property of the card

<StatCard
  backgroundColor="rgb(0, 109, 98)"
  title="actions taken about student debt"
  number="59077"
  link={{ url: '/us/campaigns/company-student-debt', text: 'Invest In Us' }}
/>

Output:

Stat Card