Knit UI
GitHub

Playground

Loading playground…

Playground
<GeoJSONSource
  data={EUROPEAN_CITIES}
/>

Examples

Points

Point features rendered as circles, sized by data via a CircleLayer.

Loading example…

PointsSourceStorybook

Route

A LineString route drawn with a styled LineLayer.

Loading example…

RouteSourceStorybook

Polygon

A Polygon filled and outlined with a FillLayer.

Loading example…

PolygonSourceStorybook

Clustering

Clustering: 400 points aggregated into count bubbles. A CircleLayer (filtered to clusters) sizes and colors bubbles via a step expression on point_count, a SymbolLayer prints the count, and a third CircleLayer (filtered to non-clustered) draws the individual points.

Loading example…

ClusteringSourceStorybook

Props

PropTypeDefaultDescription
data requiredstring | GeoJSON<Geometry, GeoJsonProperties>
buffernumber | undefined
childrenReactNode
clusterboolean | undefined
clusterMaxZoomnumber | undefined
clusterMinPointsnumber | undefined
clusterPropertiesunknown
clusterRadiusnumber | undefined
hitboxViewPadding | undefinedOverrides the default touch hitbox for the source layers.
idstring | undefined
lineMetricsboolean | undefined
maxzoomnumber | undefined
onPress((event: PressEventWithFeatures) => void) | undefinedCalled when a child Layer within the hitbox has highest z-index.
testIDstring | undefined
tolerancenumber | undefined
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<GeoJSONSourceRef> | undefined