• Home
  • Getting started
  • Way of thinking
  • Foundation
  • Components
  • Patterns
  • Content
  • Brands

Documentation

Link-wrapper

Link-wrapper is used by Card-link to be able to use the power of Next/link

In short, it receives a href and a passHref according to Next/Link and passes it on to a React forwardRef.

Code examples

This is an example of the implementation in card-link component.

// Import LinkWrapper component
  import LinkWrapper from '@components/content/link-wrapper';

// Use case from card-link
  <LinkWrapper href={href} passHref>
    <a className={reducedMotion ? styles.wrapperReduced : styles.wrapper} ref={cardRef} target={target ? '_blank' : null}>
      <Paper className='js-card elevation-auto-raise' style={{ overflow: 'hidden' }}>
        {image
          ? <Image
            src={image}
            alt={alt}
            sizes={sizes}
            transparent={transparent}
            noAnimation
          />
          : <Fallback
            alt={alt}
            sizes={sizes}
            transparent={transparent}
            noAnimation
          />
        }
        <div className={styles.content}>
          <h3 className={styles.title}>{title}</h3>
          {subtitle ? <p className={styles.subtitle}>{subtitle}</p> : null}
        </div>
      </Paper>
    </a>
  </LinkWrapper >

Props table

Prop nameTypeDefault ValueDescription
refAsrefRef to be used
childrenChildren

© DesignTech - AB Svenska Spel

What's newTerms of useAccessibility statementCookiesTeams channel [Internal]Powered by Trinidad-UI: 9.7.6

Feedback

We always want to improve the Design System and would be thrilled to get your feedback.

Please share your wisdom with us.

Microsoft Teams [internal]

Designsystem@svenskaspel.se