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.
BasePayload
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.
CommentFragment
An object representing the library item information in the payload of the LIBRARY_PUBLISH event.
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.
DevModeStatusUpdatePayload
DevResource
A dev resource in a file.
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.
FileCommentPayload
FileDeletePayload
FileMeta
A response object containing a file's metadata.
FileMetaResponse
A response object containing a file's metadata.
FileResponse
A response object containing a file.
FileUpdatePayload
FileVersionUpdatePayload
FlowStartingPoint
A starting point for a flow within a frame.
Frame
A Figma frame.
FrameInfo
Data on the frame a component resides in.
GetWebhooks
A request object for posting a webhook.
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.
LibraryItemData
An object representing the library item information in the payload of the LIBRARY_PUBLISH event.
LibraryPublishPayload
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.
Pagination
A request object for posting a webhook.
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.
PingPayload
PostComment
A request object for posting a comment.
PostWebhook
A request object for posting a webhook.
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.
PutWebhook
A request object for posting a webhook.
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.
Webhook
A response object containing a file's metadata.
WebhooksResponse
Response from the GET /v2/webhooks endpoint.

Enums

BlendMode
Enum describing how layer blends with layers below.
ComponentPropertyType
Component property type.
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.
DevModeStatus
Enum describing how layer blends with layers below.
EasingType
Enum describing animation easing curves.
EditorType
The type of editor associated with a file.
EffectType
Type of effect.
ExportFormat
Image type, supports JPG, PDF, PNG and SVG formats.
HorizontalConstraint
Type of horizontal constraint to apply.
InstanceSwapPreferredValueType
The type of node for a preferred value.
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.
LineHeightUnit
The unit of the line height value specified by the user.
LineType
LinkAccess
Access policy for users who have a link to a file.
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).
PrototypeDeviceRotation
Device rotation.
PrototypeDeviceType
Device type.
ResolvedType
Role
Access policy for users who have a link to a file.
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.
TextAutoResize
Dimensions along which text will auto resize.
TextCase
Text casing applied to the node, default is the original casing.
TextDecoration
Text decoration applied to the node, default is none.
VariableCodeSyntaxPlatform
VariableScope
VerticalConstraint
Type of vertical constraint to apply.
WebhookContext
The context for the webhook.
WebhookEvent
The context for the webhook.
WebhookStatus
The context for the webhook.
WindingRule

Extensions

$ArcDataCopyWith on ArcData
$ColorCopyWith on Color
$ColorStopCopyWith on ColorStop
$CommentCopyWith on Comment
$CommentFragmentCopyWith on CommentFragment
$CommentsResponseCopyWith on CommentsResponse
$ComponentCopyWith on Component
$ComponentPropertyCopyWith on ComponentProperty
$ComponentPropertyDefinitionCopyWith on ComponentPropertyDefinition
$ComponentResponseCopyWith on ComponentResponse
$ComponentSetCopyWith on ComponentSet
$ComponentsMetaCopyWith on ComponentsMeta
$ComponentsResponseCopyWith on ComponentsResponse
$ConstraintCopyWith on Constraint
$CursorCopyWith on Cursor
$DevModeStatusUpdatePayloadCopyWith on DevModeStatusUpdatePayload
$DevResourceCopyWith on DevResource
$EffectCopyWith on Effect
$ExportSettingCopyWith on ExportSetting
$FileCommentPayloadCopyWith on FileCommentPayload
$FileDeletePayloadCopyWith on FileDeletePayload
$FileMetaCopyWith on FileMeta
$FileMetaResponseCopyWith on FileMetaResponse
$FileResponseCopyWith on FileResponse
$FileUpdatePayloadCopyWith on FileUpdatePayload
$FileVersionUpdatePayloadCopyWith on FileVersionUpdatePayload
$FlowStartingPointCopyWith on FlowStartingPoint
$FrameInfoCopyWith on FrameInfo
$GetWebhooksCopyWith on GetWebhooks
$ImageResponseCopyWith on ImageResponse
$InstanceSwapPreferredValueCopyWith on InstanceSwapPreferredValue
$LayoutConstraintCopyWith on LayoutConstraint
$LayoutGridCopyWith on LayoutGrid
$LibraryItemDataCopyWith on LibraryItemData
$LibraryPublishPayloadCopyWith on LibraryPublishPayload
$LocalVariableCollectionCopyWith on LocalVariableCollection
$LocalVariableCopyWith on LocalVariable
$LocalVariablesMetaCopyWith on LocalVariablesMeta
$LocalVariablesResponseCopyWith on LocalVariablesResponse
$ModeCopyWith on Mode
$NodeCopyWith on Node
$NodesResponseCopyWith on NodesResponse
$OverridesCopyWith on Overrides
$PaginationCopyWith on Pagination
$PaintCopyWith on Paint
$PaintOverrideCopyWith on PaintOverride
$PathCopyWith on Path
$PingPayloadCopyWith on PingPayload
$PostCommentCopyWith on PostComment
$PostWebhookCopyWith on PostWebhook
$ProjectCopyWith on Project
$ProjectFileCopyWith on ProjectFile
$ProjectFilesResponseCopyWith on ProjectFilesResponse
$PrototypeDeviceCopyWith on PrototypeDevice
$PublishedVariableCollectionCopyWith on PublishedVariableCollection
$PublishedVariableCopyWith on PublishedVariable
$PublishedVariablesMetaCopyWith on PublishedVariablesMeta
$PublishedVariablesResponseCopyWith on PublishedVariablesResponse
$PutWebhookCopyWith on PutWebhook
$SizeCopyWith on Size
$SizeRectangleCopyWith on SizeRectangle
$StrokeWeightsCopyWith on StrokeWeights
$StyleCopyWith on Style
$StyleResponseCopyWith on StyleResponse
$StylesMetaCopyWith on StylesMeta
$StylesResponseCopyWith on StylesResponse
$TeamProjectsResponseCopyWith on TeamProjectsResponse
$TypeStyleCopyWith on TypeStyle
$UserCopyWith on User
$Vector2DCopyWith on Vector2D
$VersionCopyWith on Version
$VersionsResponseCopyWith on VersionsResponse
$WebhookCopyWith on Webhook
$WebhooksResponseCopyWith on WebhooksResponse

Exceptions / Errors

FigmaException
An error from the Figma API docs.