@patreon/studio
Version:
Patreon Studio Design System
26 lines (25 loc) • 854 B
TypeScript
export interface FloatingAccessoryProps {
/** element to position */
accessory: React.ReactNode;
/** position of the accessory */
position: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
/**
* general shape of the target element.
*
* the value of this prop is used to calculate the placement
* of the accessory relative to the target element.
**/
shape: 'circle' | 'square';
/**
* offset of the accessory.
*
* this value is added to the default shape multiplier,
* which is `1` for square and `0.7071` for circle.
*
* for example, if the shape is circle (`0.7071`) and the offset
* is `-0.2` the accessory will be positioned at `0.5071`.
*/
offset?: number;
/** component to position the accessory around */
children: React.ReactNode;
}