Skip to content

🎥 Make videos programmatically with React

docs: fittext additionalElementStyles prop

Mohit Yadav88ced21f7a0e
diff --git a/packages/docs/docs/layout-utils/fit-text.md b/packages/docs/docs/layout-utils/fit-text.md
index 2fa9e15f68..85ceaf2747 100644
--- a/packages/docs/docs/layout-utils/fit-text.md
+++ b/packages/docs/docs/layout-utils/fit-text.md
@@ -21,10 +21,23 @@ const { fontSize } = fitText({
withinWidth: width,
fontFamily: fontFamily,
fontWeight: fontWeight,
+ additionalElementStyles: {
+ textTransform: "uppercase",
+ },
});
// Example markup:
-<div style={{ fontSize, width, fontFamily, fontWeight }}>{text}</div>;
+<div
+ style={{
+ fontSize,
+ width,
+ fontFamily,
+ fontWeight,
+ textTransform: "uppercase",
+ }}
+>
+ {text}
+</div>;
```
## API
@@ -83,6 +96,12 @@ _boolean_
If set to `true`, will take a second measurement with the fallback font and if it produces the same measurements, it assumes the fallback font was used and will throw an error.
+### `additionalElementStyles`
+
+_object, optional_
+
+Pass this option if you want to add additional CSS properties to the text that should affect the resulting font size.
+
## Return value
An object with `fontSize` in pixels. Assign this to the `style` prop of your text element.