figma library

Figma API client.

To get started, retrieve your Figma access token here and start making requests.

Classes

BooleanOperation
Canvas
A Canvas node represents a Page in a Figma File. A Canvas node can then have any number of nodes as its children. Each subtree stemming from a Canvas node will represent a layer (e.g an object) on the Canvas.
Color
An RGBA color
ColorStop
A position color pair representing a gradient stop
Comment
A comment or reply left by a user
CommentsResponse
Component
An arrangement of published UI elements that can be instantiated across figma files
ComponentResponse
ComponentsMeta
ComponentsResponse
Constraint
Sizing constraint for exports
Cursor
Figma pagination cursor
Document
At the root of every File is a Document node, and from that Document node stems any Canvas nodes.
Effect
A visual effect such as a shadow or blur
Ellipse
ExportSetting
Format and size to export an asset at
FigmaClient
FigmaQuery
A wrapper that wraps all available query values for the Figma API
FileResponse
Frame
A Figma Frame
FrameInfo
Data on the frame a component resides in
Group
ImageResponse
Instance
LayoutConstraint
Layout constraint relative to containing Frame
LayoutGrid
Guides to align and place objects within a frame
Line
Node
NodesResponse
Paint
A solid color, gradient, or image texture that can be applied as fills or strokes
PostComment
Project
A Project can be identified by both the Project name, and the ProjectID.
ProjectFile
A Figma Project file
ProjectFilesResponse
Rectangle
RegularPolygon
SizeRectangle
A rectangle that expresses a bounding box in absolute coordinates
Slice
Star
Style
A set of properties that can be applied to nodes and published. Styles for a property can be created in the corresponding property's panel while editing a file.
StyleResponse
StylesMeta
StylesResponse
TeamProjectsResponse
Text
TypeStyle
Metadata for character formatting
User
A description of a Figma user
Vector
Vector2D
A 2d vector
Version
VersionsResponse

Extensions

BooleanOperationCopyWith
CanvasCopyWith
ColorCopyWith
ColorStopCopyWith
CommentCopyWith
CommentsResponseCopyWith
ComponentCopyWith
ComponentResponseCopyWith
ComponentsMetaCopyWith
ComponentsResponseCopyWith
ConstraintCopyWith
CursorCopyWith
DocumentCopyWith
EffectCopyWith
EllipseCopyWith
ExportSettingCopyWith
FileResponseCopyWith
FrameCopyWith
FrameInfoCopyWith
GroupCopyWith
ImageResponseCopyWith
InstanceCopyWith
LayoutConstraintCopyWith
LayoutGridCopyWith
LineCopyWith
NodeCopyWith
NodesResponseCopyWith
PaintCopyWith
PostCommentCopyWith
ProjectCopyWith
ProjectFileCopyWith
ProjectFilesResponseCopyWith
RectangleCopyWith
RegularPolygonCopyWith
SizeRectangleCopyWith
SliceCopyWith
StarCopyWith
StyleCopyWith
StyleResponseCopyWith
StylesMetaCopyWith
StylesResponseCopyWith
TeamProjectsResponseCopyWith
TextCopyWith
TypeStyleCopyWith
UserCopyWith
Vector2DCopyWith
VectorCopyWith
VersionCopyWith
VersionsResponseCopyWith

Constants

base → const String
Figma API base URL
'api.figma.com'

Enums

BlendMode
Enum describing how layer blends with layers below
ConstraintType
Type of constraint to apply
CounterAxisAlignItems
Determines how the auto-layout frame’s children should be aligned in the primary axis direction.
CounterAxisSizingMode
Whether the counter axis has a fixed length (determined by the user) or an automatic length (determined by the layout engine). This property is only applicable for auto-layout frames.
EasingType
Enum describing animation easing curves
EffectType
Type of effect
ExportFormat
Image type, supports JPG, PDF, PNG and SVG
HorizontalConstraint
LayoutAlign
How the layer is aligned inside an auto-layout frame. This property is only provided for direct children of auto-layout frames. [...]
LayoutMode
Whether this layer uses auto-layout to position its children.
LayoutPattern
Orientation of the grid as a string enum
LineHeightUnit
The unit of the line height value specified by the user.
Operation
A string enum indicating the type of boolean operation applied
OverflowDirection
Defines the scrolling behavior of the frame, if there exist contents outside of the frame boundaries. The frame can either scroll vertically, horizontally, or in both directions to the extents of the content contained within it. This behavior can be observed in a prototype.
PaintType
Type of paint as a string enum
PrimaryAxisAlignItems
Determines how the auto-layout frame’s children should be aligned in the primary axis direction.
PrimaryAxisSizingMode
Whether the primary axis has a fixed length (determined by the user) or an automatic length (determined by the layout engine)
ScaleMode
Image scaling mode
StrokeAlign
Position of stroke relative to vector outline
StrokeCap
A string enum with value of StrokeCap.none, StrokeCap.round, StrokeCap.squary, StrokeCap.lineArrow or StrokeCap.triangleArrow, describing the end caps of vector paths.
StrokeJoin
A string enum with value of StrokeJoin.miter, StrokeJoin.bevel, or StrokeCap.round, describing how corners in vector paths are rendered.
StyleType
The type of style as string enum
StyleTypeKey
The type of style as string enum for keys
TextAlignHorizontal
Horizontal text alignment as string enum
TextAlignVertical
Vertical text alignment as string enum
TextCase
Text casing applied to the node, default is the original casing
TextDecoration
Text decoration applied to the node, default is none
VerticalConstraint

Exceptions / Errors

FigmaError
An error from the Figma API docs.