Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions apps/www/app/content/fundamentals/en/figma/slots-in-figma.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: Swap content using "swap"
description: Learn how to use the swap feature in Figma to customise components without detaching them.
date: 2026-02-06
category: Figma
color: yellow
icon: LayersPlusIcon
published: true
order: 20
---

When working with components in Figma, you will often want to customise content without losing the connection to Designsystemet. Detaching a component solves this quickly, but means you miss out on future updates from the library.

With **swap**, you can keep the connection and replace content when needed. This provides flexibility while the structure and styling remain unchanged.

## What is swap?
Swap lets you replace one component with another directly in an instance. When a component is selected, you will find the instance menu in the right-hand panel in Figma.

In the video below, we replace the `body` in the `Alert` component with a custom component containing text, `details`, and buttons.

<ResponsiveIframe
src='/img/swap-alert.mp4'
title='Screen recording showing how to swap one component with another in Figma.'
frameBorder='0'
allow='autoplay; fullscreen; picture-in-picture'
allowFullScreen
aspectRatio='16-9'
/>

## Why use swap?
- **Keeps the connection to the library.** Changes to the main component are inherited automatically.
- **Provides flexibility.** You can vary content without changing the structure.
- **Ensures consistency.** Design and behaviour are defined by Designsystemet.

## Slot areas in components
Several of our components include built-in **slots**, as we cannot anticipate every type of content you may need. This applies to components such as `Card`, `Details`, and `Dialog`.

A slot is an open area within a component where you can place your own content. This can range from simple text to more complex combinations of components.

If the content consists of multiple elements, we recommend grouping them into a separate component and placing it in the slot using swap, as shown in the video above.

<Card data-color='brand3' variant="tinted">
**Slots in Figma are coming**

Figma has announced support for [built-in slot functionality (figma.com)](https://help.figma.com/hc/en-us/articles/35794667554839-What-s-new-from-Schema-2025#h_01K84PB569NTFMXBDS36C8DCPV). When this becomes available, we will update the Community file and this article on an ongoing basis.
</Card>
46 changes: 46 additions & 0 deletions apps/www/app/content/fundamentals/no/figma/slots-in-figma.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: Bytte innhold med "swap"
description: Lær hvordan du kan bruke "swap"-funksjonen i Figma for å tilpasse komponenter uten å detache dem.
date: 2026-02-06
category: Figma
color: yellow
icon: LayersPlusIcon
published: true
order: 20
---

Når du jobber med komponenter i Figma, vil du ofte tilpasse innhold uten å miste koblingen til Designsystemet. Å *detache* komponenten løser problemet raskt, men gjør at du mister videre oppdateringer fra biblioteket.

Med **swap** kan du beholde koblingen og samtidig bytte innhold ved behov. Det gir fleksibilitet, samtidig som struktur og stil forblir uendret.

## Hva er swap?
Swap lar deg bytte ut en komponent med en annen direkte i en instans. Du finner instans-menyen i høyresidepanelet når du har valgt en komponent.

I videoen under bytter vi ut `body` i `Alert`-komponenten med en egendefinert komponent som inneholder tekst, `details` og knapper.

<ResponsiveIframe
src='/img/swap-alert.mp4'
title='Skjermopptak av Figma som viser hvordan bytte ut en komponent med en annen.'
frameBorder='0'
allow='autoplay; fullscreen; picture-in-picture'
allowFullScreen
aspectRatio='16-9'
/>

## Hvorfor bruke swap?
- **Beholder koblingen til biblioteket.** Endringer i hovedkomponenten arves automatisk.
- **Gir fleksibilitet.** Du kan variere innhold uten å endre strukturen.
- **Sikrer konsistens.** Design og oppførsel styres av Designsystemet.

## Slots-områder i komponenter
Flere av komponentene våre har innebygde **slots**, fordi vi ikke vet hva slags innhold du har behov for. Dette gjelder blant annet `Card`, `Details` og `Dialog`.

En slot er et åpent område inne i en komponent der du kan plassere eget innhold. Det kan være alt fra enkel tekst til mer komplekse sammensetninger av komponenter.

Hvis innholdet består av flere elementer, anbefaler vi å samle dem i en egen komponent og deretter plassere den i slot-området med swap, slik videoen over viser.

<Card data-color='brand3' variant="tinted">
**Slots i Figma er på vei**

Figma har annonsert støtte for [innebygd slots-funksjonalitet (figma.com)](https://help.figma.com/hc/en-us/articles/35794667554839-What-s-new-from-Schema-2025#h_01K84PB569NTFMXBDS36C8DCPV). Når dette blir tilgjengelig, vil vi oppdatere Community-filen og denne artikkelen løpende.
</Card>
Binary file added apps/www/public/img/swap-alert.mp4
Binary file not shown.
Loading