Create a new code override file in Framer.
Inside the newly created override file, replace the override logic with this code.
import type { ComponentType } from "react"
import { createStore } from "https://framer.com/m/framer/store.js@^1.0.0"
import { randomColor } from "https://framer.com/m/framer/utils.js@^0.9.0"
const useStore = createStore({
background: "#0099FF",
})
const LINES = 4
export default function withLineTruncate(Component): ComponentType {
return (props) => {
const styles = {
...props?.style,
WebkitLineClamp: `${LINES}`,
WebkitBoxOrient: "vertical",
textOverflow: "ellipsis",
display: "-webkit-box",
overflow: "hidden",
}
return (
<>
<Component {...props} style={styles} />
</>
)
}
}
Apply the code override to text layer which you want to truncate.