extends BaseControlDescription
{ type: ControlType.Array; control: ArrayItemControlDescription
; /** @deprecated This property has been renamed to control. */ propertyControl?: ArrayItemControlDescription
; maxCount?: number; defaultValue?: any[]; } /** * Array sub type * @public */ export declare type ArrayItemControlDescription
= Omit {
title?: string;
description?: string;
hidden?(props: P, rootProps: any): boolean;
}
/**
* @remarks do no use separately from FrameProps
* @public
* */
export declare interface BaseFrameProps {
/**
* Add a name to the Frame. This property does not change the behaviour of a Frame, but makes it easier to identify it in your code.
* @remarks
* The name will be rendered in the `data-framer-name` attribute of the outputted div, so the Frame is recognizable in the HTML DOM too.
* ```jsx
*
* ```
* @public
*/
name: string;
}
/**
* @public
*/
declare enum Bezier {
Linear = "linear",
Ease = "ease",
EaseIn = "ease-in",
EaseOut = "ease-out",
EaseInOut = "ease-in-out"
}
declare interface BezierOptions {
curve: Curve;
duration: number;
}
/** @public */
export declare type BlendingMode = "normal" | "multiply" | "screen" | "overlay" | "darken" | "lighten" | "color-dodge" | "color-burn" | "hard-light" | "soft-light" | "difference" | "exclusion" | "hue" | "saturation" | "color" | "luminosity";
/** @public */
export declare interface BlendingProperties {
blendingMode: BlendingMode;
}
/** @public */
export declare interface BooleanControlDescription extends BaseControlDescription {
type: ControlType.Boolean;
defaultValue?: boolean;
/**
* @deprecated No longer recommended because it should be clear what happens when assigning a
* boolean variable.
*/
disabledTitle?: string;
/**
* @deprecated No longer recommended because it should be clear what happens when assigning a
* boolean variable.
*/
enabledTitle?: string;
}
/** @public */
export declare type BorderStyle = "solid" | "dashed" | "dotted" | "double";
/** @public */
export declare interface BoxShadow {
type?: "box" | "realistic";
inset: boolean;
color: string;
x: number;
y: number;
blur: number;
spread: number;
diffusion: number;
focus: number;
}
/** @public */
export declare const BoxShadow: {
is: (shadow: any) => shadow is BoxShadow;
toCSS: (shadow: BoxShadow) => string;
};
/** @public */
export declare interface BoxShadowProperties {
shadows: Readonly extends BaseControlDescription {
type: ControlType.Color;
defaultValue?: string;
optional?: boolean;
}
/** @public */
export declare enum ColorFormat {
RGB = "rgb",
HSL = "hsl",
HSV = "hsv",
HEX = "hex",
NAME = "name"
}
/** @public */
export declare interface ColorHSL {
h: number;
s: number;
l: number;
}
/** @public */
export declare type ColorHSLA = ColorHSL & {
a: number;
};
/** @public */
declare interface ColorHSV {
h: number;
s: number;
v: number;
}
/** @public */
export declare type ColorHSVA = ColorHSV & {
a: number;
};
/**
* Various Color functions, such as {@link (Color:namespace).mix} and {@link
* (Color:namespace).interpolate}, take an optional color model that
* determines how two colors are mixed together.
*
* @remarks
*
* ```javascript
* const newColor = Color.mix(Color("red"), Color("blue"), {model: ColorMixModelType.HSL})
* ```
*
* @public
*/
export declare enum ColorMixModelType {
/**
* Use the {@link https://en.wikipedia.org/wiki/RGB_color_model | RGB color space} without an alpha value
*
* @remarks
*
* ```javascript
* const newColor = Color.mix(Color("red"), Color("blue"), {model: ColorMixModelType.RGB})
* ```
*
* @public
*/
RGB = "rgb",
/**
* Use the {@link https://en.wikipedia.org/wiki/RGB_color_model | RGB color space} color space with an alpha value
*
* @remarks
*
* ```javascript
* const newColor = Color.mix(Color("red"), Color("blue"), {model: ColorMixModelType.RGBA})
* ```
*
* @public
*/
RGBA = "rgba",
/**
* Use the {@link https://en.wikipedia.org/wiki/HSL_and_HSV | HSL} color space with an alpha value
*
* @remarks
*
* ```javascript
* const newColor = Color.mix(Color("red"), Color("blue"), {model: ColorMixModelType.HSL})
* ```
*
* @public
*/
HSL = "hsl",
/**
* Use the {@link https://en.wikipedia.org/wiki/HSL_and_HSV | HSL} color space with an alpha value
*
* @remarks
*
* ```javascript
* const newColor = Color.mix(Color("red"), Color("blue"), {model: ColorMixModelType.HSLA})
* ```
*
* @public
*/
HSLA = "hsla",
/**
* Use the {@link http://www.hsluv.org | HSLuv } human friendly color model
*
* @remarks
*
* ```javascript
* const newColor = Color.mix(Color("red"), Color("blue"), {model: ColorMixModelType.HUSL})
* ```
*
* @public
*/
HUSL = "husl"
}
/** @public */
export declare interface ColorMixOptions {
model?: ColorMixModelType;
}
declare interface ColorRGB {
r: number;
g: number;
b: number;
}
/** @public */
export declare type ColorRGBA = ColorRGB & {
a: number;
};
/**
* Describes a single font used by a component.
*
* This should have enough data to construct a corresponding [FontFace] object
* or a CSS `@font-face` rule.
*
* [FontFace]: https://drafts.csswg.org/css-font-loading/#fontface-interface
*
* @public
*/
export declare interface ComponentFont extends ComponentFontV1 {
source: FontSourceName;
}
/**
* Describes a bundle of fonts used by a single component, together with feature
* flags to indicate which font features that component supported at the time of
* codegen.
*/
declare type ComponentFontBundle = {
/**
* This flag specifies whether the font bundle includes the specific font
* weights of Framer’s Inter font that the component uses. New smart
* components do that (which means we can emit CSS only for Inter fonts that
* are actually used); older smart components don’t (which means some places
* will emit CSS for all Inter fonts if this flag is not set).
* https://www.notion.so/framer/RFC-ComponentFont-v2-d5fd3e822fb049ffb6971554ab0e4e42
*/
explicitInter: boolean;
fonts: ComponentFont[];
};
/**
* An older version of ComponentFont that doesn’t include the `source` field.
* While this version of ComponentFont is not used internally, it may still be
* passed into `addFonts()` by older versions of smart components.
*/
declare interface ComponentFontV1 {
url: string;
family: string;
style?: string;
weight?: string;
stretch?: string;
unicodeRange?: string;
}
/** @public */
export declare interface ComponentInstanceDescription extends BaseControlDescription {
type: ControlType.ComponentInstance;
}
/**
* @public
*/
declare type ComponentWithPreload = NumberControlDescription | EnumControlDescription | BooleanControlDescription | StringControlDescription | RichTextControlDescription | ColorControlDescription | FusedNumberControlDescription | SegmentedEnumControlDescription | ImageControlDescription | ResponsiveImageControlDescription | FileControlDescription | ComponentInstanceDescription | ArrayControlDescription | EventHandlerControlDescription | TransitionControlDescription | LinkControlDescription | DateControlDescription | ObjectControlDescription | FontControlDescription | PageScopeControlDescription | ScrollSectionRefControlDescription | CustomCursorControlDescription ;
declare type ControlPoints = [number, number, number, number];
/**
* Used by the {@link PropertyControls} and specifies the type of user interface for receiving
* input. Each field has a distinct set of properties though they all accept `title` and `hidden`
* properties.
*
* @remarks
* ```javascript
* export function MyComponent({ title }) {
* return {title}
* }
*
* addPropertyControls(MyComponent, {
* title: {
* type: ControlType.String,
* title: "Title",
* hidden: (props) => true
* },
* }
* ```
* @public
*/
export declare enum ControlType {
/**
* A control that displays an on / off checkbox. The associated property will be `true` or `false`,
* depending on the state of the checkbox. Includes an optional `defaultValue`, which is set to `true` by default. You can also customize the labels displayed in the property panel with the `enabledTitle` and `disabledTitle` properties.
*
* @remarks
* ```javascript
* export function MyComponent(props) {
* return {props.showText ? "Hello World" : null}
* }
*
* addPropertyControls(MyComponent, {
* showText: {
* type: ControlType.Boolean,
* title: "Show Text",
* defaultValue: true,
* enabledTitle: "On",
* disabledTitle: "Off",
* },
* })
* ```
*/
Boolean = "boolean",
/**
* A control that accepts any numeric value. This will be provided directly as a property.
* Will display an input field with a range slider by default. The
* `displayStepper` option can be enabled to include a stepper control instead.
*
* @remarks
* ```javascript
* export function MyComponent(props) {
* return {rotation}
* }
*
* addPropertyControls(MyComponent, {
* rotation: {
* type: ControlType.Number,
* defaultValue: 0,
* min: 0,
* max: 360,
* unit: "deg",
* step: 0.1,
* displayStepper: true,
* },
* })
* ```
*/
Number = "number",
/**
* A control that accepts plain text values. This will be provided directly as a property.
* Will display an input field with an optional placeholder value.
* If `obscured` attribute is set to true a password input field will be used instead of a regular text input
* so that the value in the input will be visually obscured, yet still be available as plain text inside the component.
* `displayTextArea` can be enabled to display a multi-line input area instead.
*
* @remarks
* ```javascript
* export function MyComponent(props) {
* return {props.title} — {props.body}
* }
*
* addPropertyControls(MyComponent, {
* title: {
* type: ControlType.String,
* defaultValue: "Framer",
* placeholder: "Type something…",
* },
* body: {
* type: ControlType.String,
* defaultValue: "Lorem ipsum dolor sit amet.",
* placeholder: "Type something…",
* displayTextArea: true,
* },
* })
* ```
*/
String = "string",
/**
* A control that can be used to take a single number or four distinct
* numeric input fields. The typical use case for this control is for visual
* properties like border, padding or margin. It will display an input field
* to accept a single value, alongside a segmented control allowing four
* distinct values to be provided.
*
* You can also set the default value for each valueKey as well as the
* toggleKey by setting their values on `defaultProps`.
*
*
* ```javascript
* export function MyComponent({
* radius = 50,
* topLeft,
* topRight,
* bottomRight,
* bottomLeft,
* isMixed = false,
* }) {
* const borderRadius = isMixed
* ? `${topLeft}px ${topRight}px ${bottomRight}px ${bottomLeft}px`
* : `${radius}px`
* return
* }
*
* addPropertyControls(MyComponent, {
* radius: {
* type: ControlType.FusedNumber,
* title: "Radius",
* defaultValue: 50,
* toggleKey: "isMixed",
* toggleTitles: ["All", "Individual"],
* valueKeys: ["topLeft", "topRight", "bottomRight", "bottomLeft"],
* valueLabels: ["NW", "NE", "SE", "SW"],
* min: 0,
* },
* })
*
* // Set the default value for each valueKey as well as the toggleKey by setting their values on `defaultProps`:
* MyComponent.defaultProps = {
* radius: 10,
* isMixed: true,
* topLeft: 5,
* topRight: 15,
* bottomRight: 5,
* bottomLeft: 15,
* }
* ```
*/
FusedNumber = "fusednumber",
/**
* A property control that represents a list of options. The list contains primitive values and each
* value has to be unique. The selected option will be provided as a property. This control is displayed
* as a dropdown menu in which a user can select one of the items.
* `displaySegmentedControl` can be enabled to display a segmented control instead.
*
* ```javascript
* export function MyComponent(props) {
* const value = props.value || "a"
* const colors = { a: "red", b: "green", c: "blue" }
* return {value}
* }
*
* addPropertyControls(MyComponent, {
* value: {
* type: ControlType.Enum,
* defaultValue: "a",
* options: ["a", "b", "c"],
* optionTitles: ["Option A", "Option B", "Option C"],
* },
* })
* ```
*/
Enum = "enum",
/**
* Deprecated, please use {@link ControlType.Enum} and enable displaySegmentedControl.
*
* @deprecated Please use {@link ControlType.Enum} and enable displaySegmentedControl.
* @remarks
* ```javascript
* export function MyComponent(props) {
* const value = props.value || "a"
* const colors = { a: "red", b: "green", c: "blue" }
* return {value}
* }
*
* addPropertyControls(MyComponent, {
* value: {
* type: ControlType.SegmentedEnum,
* defaultValue: "a",
* options: ["a", "b", "c"],
* optionTitles: ["A", "B", "C"],
* },
* })
* ```
*/
SegmentedEnum = "segmentedenum",
/**
* A control that represents a color value. It will be included in the component props as a string.
* This control is displayed as a color field and will provide the selected color in either
* HEX (`"#fff"`) or HSL (`hsla(203, 87%, 50%, 0.5)`) notation, depending on
* whether there is an alpha channel.
*
* @remarks
* ```javascript
* function MyComponent(props) {
* return
* }
*
* addPropertyControls(MyComponent, {
* background: {
* type: ControlType.Color,
* defaultValue: "#fff",
* },
* })
* ```
*/
Color = "color",
/**
* Deprecated, please use {@link ControlType.ResponsiveImage}’s `src` field instead.
*
* @deprecated Please use {@link ControlType.ResponsiveImage}’s `src` field instead.
*/
Image = "image",
/**
* A control that allows the user to pick an image resource. Displayed as an image picker
* with associated file picker.
*
* The chosen image will be provided in the component props as an object with `src` and `srcSet` properties:
* - `src`: a string containing the URL of a full resolution image
* - `srcSet`: an optional string with scaled down image variants. This is typically passed into [` extends BaseControlDescription {
type: ControlType.CustomCursor;
}
/**
* Combine values and create a className string. Falsy values are not included.
*
* This helper is commonly exported by css-in-js libraries like Linaria, or
* Emotion as cx. This is the implementation from Linaria:
* https://github.com/callstack/linaria/blob/master/packages/core/src/cx.ts.
*
* We need it here so we can use it in es-modules.
*
* @public
*/
export declare function cx(...classNames: ClassName[]): string;
/**
* Flag setVariantState as cycling variants.
* @public
*/
export declare const CycleVariantState: unique symbol;
declare interface DampingDurationSpringOptions {
dampingRatio: number;
duration: number;
velocity: number;
mass: number;
}
export declare const Data: {
extends BaseControlDescription {
type: ControlType.Date;
defaultValue?: string;
}
/**
* @deprecated Use {@link FrameProps.transition} instead
*/
declare interface DeprecatedAnimationOptions extends BaseControlDescription {
type: ControlType.Enum;
defaultValue?: string | boolean | number | undefined | null;
options: (string | boolean | number | undefined | null)[];
optionTitles?: string[];
displaySegmentedControl?: boolean;
/** Used when displaySegmentedControl is enabled. If not given defaults to horizontal */
segmentedControlDirection?: "horizontal" | "vertical";
}
declare type EventDispatcher = (type: string, event: FramerEvent, target: EventTarget) => void;
declare type EventHandler = (event: FramerEvent) => void;
/** @public */
export declare interface EventHandlerControlDescription extends BaseControlDescription {
type: ControlType.EventHandler;
}
/**
* @public
*/
export declare type FadeTransitionOptions = NavigationTransitionAnimation;
/** @public */
export declare interface FileControlDescription extends BaseControlDescription {
type: ControlType.File;
allowedFileTypes: string[];
}
/** @public */
export declare interface FilterNumberProperties {
brightness: number;
contrast: number;
grayscale: number;
hueRotate: number;
invert: number;
saturate: number;
sepia: number;
blur: number;
}
/** @public */
export declare interface FilterProperties extends FilterNumberProperties {
dropShadows: Readonly extends BaseControlDescription {
type: ControlType.Font;
controls?: "basic" | "extended";
defaultFontType?: "monospace" | "sans-serif";
defaultValue?: FontControlDefaultValue;
displayTextAlignment?: boolean;
displayFontSize?: boolean;
}
/** @public */
declare type FontSourceName = "local" | "google" | "fontshare" | "custom";
/** @public */
export declare const Frame: React_2.ForwardRefExoticComponent extends BaseControlDescription {
type: ControlType.FusedNumber;
defaultValue?: number;
toggleKey: keyof P;
toggleTitles: [string, string];
valueKeys: [keyof P, keyof P, keyof P, keyof P];
valueLabels: [string, string, string, string];
min?: number;
}
declare type FXProps = Partial extends BaseControlDescription {
type: ControlType.Image;
}
/** @public */
export declare type ImageFit = "fill" | "fit" | "stretch" | "tile";
/** @public */
declare interface ImageProps extends MotionDivProps, BackgroundImageProps {
as?: keyof HTMLElementTagNameMap;
}
/** @public */
export declare type IncomingColor = ColorRGB | ColorHSL | ColorRGBA | ColorHSLA | string;
/**
* @public
*/
declare interface Interpolation , S> extends Component {
static readonly defaultProps: LayerProps;
static applyWillChange(props: WillChangeTransformProp, style: MotionStyle, usingMotionStyle: boolean): void;
/** @private (Just using `private` breaks compilation unless using `stripInternal`) */
layerElement: HTMLElement | SVGElement | null;
setLayerElement: (element: HTMLElement | SVGElement | null) => void;
}
/** @public */
export declare interface LayerProps extends IdentityProps, WillChangeTransformProp, DOMLayoutProps {
children?: ReactNode;
key?: React_2.Key;
}
export { LayoutGroupContext }
/**
* @public
*/
export declare type LinearGradient = LinearGradientBase & (SimpleGradient | MultiStopGradient);
/**
* @public
*/
export declare const LinearGradient: {
/**
* @param value -
*/
isLinearGradient: (value: any) => value is LinearGradient;
};
/**
* @public
*/
export declare interface LinearGradientBase {
alpha: number;
angle: number;
}
/** @public */
export declare const Link: React_2.ForwardRefExoticComponent extends BaseControlDescription {
type: ControlType.Link;
defaultValue?: string;
}
declare interface LinkProps {
href: string | LinkToWebPage | undefined;
/**
* Which browsing context to display the linked URL. If not provided, the
* Link component will only open the link in a new tab if the href is an
* external URL.
*/
openInNewTab?: boolean;
smoothScroll?: boolean;
}
declare interface LinkToWebPage {
webPageId: string;
hash?: string;
pathVariables?: Record extends BaseControlDescription {
type: ControlType.Number;
defaultValue?: number;
max?: number;
min?: number;
unit?: string;
step?: number;
displayStepper?: boolean;
}
/**
* @remarks This feature is still in beta
* @public
*/
export declare interface ObjectControlDescription extends BaseControlDescription {
type: ControlType.Object;
controls: {
[key: string]: ObjectPropertyControlDescription;
};
defaultValue?: {
[key: string]: any;
};
buttonTitle?: string;
optional?: boolean;
icon?: ObjectControlIcon;
}
/**
* Object Control Icons provided by Framer
*/
declare type ObjectControlIcon = "object" | "effect" | "color" | "interaction" | "boolean";
/**
* Object sub type
* Currently not supported: component instance, and event handler.
* @public
*/
export declare type ObjectPropertyControlDescription = NumberControlDescription | EnumControlDescription | BooleanControlDescription | StringControlDescription | RichTextControlDescription | ColorControlDescription | SegmentedEnumControlDescription | ImageControlDescription | ResponsiveImageControlDescription | FileControlDescription | TransitionControlDescription | LinkControlDescription | DateControlDescription | ArrayControlDescription | ObjectControlDescription | FusedNumberControlDescription | FontControlDescription | PageScopeControlDescription | ScrollSectionRefControlDescription | CustomCursorControlDescription ;
/**
* @public
*/
declare type Observer = (props: P) => Partial ;
/** @public */
export declare type OverrideObject extends BaseControlDescription {
type: ControlType.PageScope;
}
declare interface ParallaxTransformOptions {
speed: number;
adjustPosition: boolean;
offset: number;
parallaxTransformEnabled: boolean | undefined;
}
declare type Placement = "top" | "right" | "bottom" | "left";
/**
* @public
*/
export declare function Point(x: number, y: number): Point;
/**
* @public
*/
export declare interface Point {
x: number;
y: number;
}
/**
* @public
*/
export declare namespace Point {
/** @public */
const isEqual: (a: Point, b: Point) => boolean;
}
declare interface PositionAbsoluteProperties {
}
declare interface PositionFixedProperties {
}
/** @public */
export declare interface PositionStickyProperties {
}
declare const prefix = "__framer__";
declare type Prefixed`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/srcset)
* and helps the browser to load a smaller image when a full-size one isn’t necessary.
* - `alt`: an optional description of the image.
*
* @remarks
* ```javascript
* function MyComponent(props) {
* return
* }
*
* addPropertyControls(MyComponent, {
* image: {
* type: ControlType.ResponsiveImage,
* }
* })
* ```
*/
ResponsiveImage = "responsiveimage",
/**
* A control that allows the user to pick a file resource. It will be
* included in the component props as an URL string.
* Displayed as an file picker that will open a native file browser. The
* selected file will be provided as a fully qualified URL. The
* `allowedFileTypes` property must be provided to specify acceptable file
* types.
*
* @remarks
* ```javascript
* export function MyComponent(props) {
* return (
*
*
*
* )
* }
*
* addPropertyControls(MyComponent, {
* filepath: {
* type: ControlType.File,
* allowedFileTypes: ["mov"],
* },
* })
* ```
*/
File = "file",
/**
* A control that references to another component on the canvas,
* included in the component props as a React node.
* The component will have an outlet to allow linking to other Frames.
* Available Frames will also be displayed in a dropdown menu in the
* properties panel. The component reference will be provided as a property.
* As a convention, the name for the property is usually just `children`.
*
* Multiple components can be linked by combining the `ComponentInstance`
* type with the {@link ControlType.Array}.
*
* ```javascript
* export function MyComponent(props) {
* return