figma library

Figma API client library.

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

Classes

ArcData
Information about the arc properties of an ellipse. 0° is the x axis and increasing angles rotate clockwise.
BooleanOperation
Boolean operations combine any set of shape layers through one of four formulas: Union, Subtract, Intersect, and Exclude.
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, represented by float values for each channel.
ColorStop
A position color pair representing a gradient stop.
Comment
A comment or reply left by a user.
CommentsResponse
Response wrapping a list of Comments from the Figma API docs.
Component
An arrangement of published UI elements that can be instantiated across Figma files.
ComponentNode
A component is a reusable piece of design that can be applied to different frames. Components can contain other components.
ComponentProperty
Component properties.
ComponentPropertyDefinition
Definition of a component property.
ComponentResponse
Response wrapping a Component from the Figma API docs.
ComponentSet
A node containing a set of variants of a component.
ComponentsMeta
Response wrapping a list of Components from the Figma API docs.
ComponentsResponse
Response wrapper containing a list of Components from the Figma API docs.
Constraint
Sizing constraint for exports.
Cursor
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
An ellipse shaped vector.
ExportSetting
Format and size to export an asset at.
FigmaClient
A client for interacting with the Figma API.
FigmaQuery
A wrapper that wraps all available query values for the Figma API.
FileResponse
A response object containing a file.
FlowStartingPoint
A starting point for a flow within a frame.
Frame
A Figma frame.
FrameInfo
Data on the frame a component resides in.
Group
ImageResponse
A response object containing a list of images.
Instance
InstanceSwapPreferredValue
A preferred value for an instance swap property.
LayoutConstraint
Layout constraint relative to containing Frame.
LayoutGrid
Guides to align and place objects within a frame.
Line
LocalVariable
A response object containing a list of styles.
LocalVariableCollection
A grouping of related Variable objects each with the same modes.
LocalVariablesMeta
LocalVariablesResponse
A response object containing a list of styles.
Mode
A response object containing a list of styles.
Node
A generic node in the document.
NodesResponse
A response object containing a list of a project's files.
Overrides
All overrides for a component.
Paint
A solid color, gradient, or image texture that can be applied as fills or strokes.
PaintOverride
Paint metadata to override default paints.
Path
A path in a frame.
PostComment
A request object for posting a comment.
Project
A Project can be identified by both the Project name, and the ProjectID.
ProjectFile
A Figma project file.
ProjectFilesResponse
A response object containing a list of a project's files.
PrototypeDevice
A device used for a prototype.
PublishedVariable
A response object containing a list of styles.
PublishedVariableCollection
A response object containing a list of styles.
PublishedVariablesMeta
A response object containing a map of local variables and local variable collections.
PublishedVariablesResponse
A response object containing a list of styles.
Rectangle
A rectangle is a rectangular-shaped vector that has a width and height and may have rounded corners.
RegularPolygon
Section
Represents a section in the Figma document.
Size
A width and a height.
SizeRectangle
A rectangle that expresses a bounding box in absolute coordinates.
Slice
A slice is a special kind of node that represents a section of the canvas that can be exported. Slices do not clip their children, and can contain children that are outside of their bounds.
Star
A star shape represented as a Vector.
StrokeWeights
Individual stroke weights for Frame and Vector nodes.
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
A response object containing a Style object.
StylesMeta
Wrapper containing a Style list along some metadata.
StylesResponse
A response object containing a list of styles.
TeamProjectsResponse
A response object containing a list of a team's projects.
Text
A text node, represented as a Vector and modified by a TypeStyle.
TypeStyle
Metadata for character formatting.
User
A description of a Figma user.
Vector
A vector node, either a path or a group of paths. All geometry in a vector is either strokes or fills. Shapes like Ellipse, Rectangle and Line are vectors, as well as Text, among others.
Vector2D
A 2D vector, represented by an x and y coordinate.
Version
A version of a file.
VersionsResponse
A response object containing a list of versions.

Enums

BlendMode
Enum describing how layer blends with layers below.
ComponentPropertyType
Component property type.
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.
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.
LayoutPositioning
Type of layout positioning applied to a node.
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).
ResolvedType
ScaleMode
Image scaling mode.
StrokeAlign
Position of stroke relative to vector outline.
StrokeCap
A string enum with value of StrokeCap.none, StrokeCap.round, StrokeCap.square, 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.
TextDecoration
Text decoration applied to the node, default is none.
VariableCodeSyntaxPlatform
VariableScope

Constants

base → const String
Figma API base URL.
kIsWeb → const bool
A constant that is true if the application was compiled to run on the web.

Exceptions / Errors

FigmaException
An error from the Figma API docs.