Knit UI
GitHub

Playground

Loading playground…

false
Playground
<Affix
  withinPortal={false}
  zIndex={200}
  position={{ bottom: 0, right: 0 }}
>
  <Box
    backgroundColor="$color8"
    paddingHorizontal="$md"
    paddingVertical="$sm"
    borderRadius="$md"
  >
    <Text color="white">Pinned content</Text>
  </Box>
</Affix>

Examples

Bottom Right

Default placement — bottom-right corner of the viewport.

Loading example…

Bottom RightSourceStorybook

Top Left

Top-left placement using spacing tokens as offsets.

Loading example…

Top LeftSourceStorybook

Token Offsets

Offsets expressed as Tamagui space tokens instead of raw numbers.

Loading example…

Token OffsetsSourceStorybook

Without Portal

Rendered in-place (withinPortal={false}) — does not escape overflow:hidden ancestors.

Loading example…

Without PortalSourceStorybook

Scroll To Top

A realistic scroll-to-top button pattern pinned to the bottom-right.

Loading example…

Scroll To TopSourceStorybook

Shadows

All five shadow levels stacked in a contained frame to compare elevation.

Loading example…

ShadowsSourceStorybook

All Corners

All four corners shown simultaneously using four independent Affix layers.

Loading example…

All CornersSourceStorybook

Props

PropTypeDefaultDescription
disabled systemboolean | undefined
positionAffixPosition | undefined{ bottom: 0, right: 0 }Edge offsets — top, right, bottom, left. Accepts `$`-space tokens ('$md') or raw numbers.
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
unset · xs · sm · md · lg · xl
Elevation — drop shadow from the shared ladder.
theme systemThemeName | null | undefinedApplies a theme to this element
withinPortalboolean | undefinedtrueWhen true the layer is rendered through a Portal so it escapes transformed / overflow:hidden ancestors.
zIndexnumber | undefined200Stack order of the fixed layer.
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<TamaguiElement> | undefined

Plus 496 inherited style props from Box — the full Tamagui/React Native style surface, including token shorthands like p, mx, bg and c. See Tokens for the scales they accept, or the full list.