The Figma plugin that helps developers with aspect ratio calculations.
I built this plugin after learning about the CSS aspect-ratio
property and getting tired of doing aspect ratio calculations manually. With AspectMatic, you can calculate aspect ratios instantly and format them in multiple ways.
Head to Figma Community to install the plugin.
-
Separator Options: Choose between colon (:) or slash (/) to format aspect ratios.
-
Ratio Formats:
- Regular Ratio: A simple division format for width and height, such as 300:9 or 300/9.
- Reduced Ratio: The simplified version of the regular ratio, like 100:3.
- Decimal Form: The ratio expressed as a decimal number, such as 33.33.
- Rounded Decimal Form: The decimal ratio rounded to the nearest whole number, such as 33.
-
Aspect Ratio History: View and manage the history of calculated aspect ratios.
-
Easy Copy: Quickly copy any aspect ratio to your clipboard for use in your designs.
-
User-Friendly Interface: Clean and intuitive UI designed to streamline the aspect ratio calculation process.
-
Select Node(s): Click on one or more nodes in Figma to start the aspect ratio calculation process.
-
Choose a Separator: Decide whether to use colon (:) or slash (/) as your ratio separator.
-
Select a Ratio Form: Pick from one of four ratio forms (Regular Ratio, Reduced Ratio, Decimal, or Rounded Decimal).
-
Generate and Copy: Click "Get AR" to calculate the aspect ratio(s). Easily copy the results for use in your projects.
Contributions are welcome! If you'd like to contribute to AspectMatic, please open a pull request or raise an issue in the repository.
-
Clone the repository:
git clone https://github.com/Jemeni11/AspectMatic.git
-
Install dependencies:
pnpm install
-
Build the plugin:
pnpm build
This will generate a
manifest.json
file and abuild/
directory containing the JavaScript bundle(s) for the plugin. -
Watch for changes:
To watch for code changes and rebuild the plugin automatically:
pnpm watch
-
Install the plugin:
- In the Figma desktop app, open a Figma document.
- Search for and run
Import plugin from manifest…
via the Quick Actions search bar. - Select the
manifest.json
file that was generated by thebuild
script.
-
Debugging: Use
console.log
statements and the Figma developer console (access viaShow/Hide Console
in Quick Actions).
AspectMatic was developed by Emmanuel Jemeni, a frontend developer.
Built with Create Figma Plugin, Preact, TypeScript, Prettier, and TailwindCSS.
If you find this plugin helpful and would like to support my work, feel free to buy me a coffee.
For any contributions or issues, check out the AspectMatic repository.
- LinkedIn: Emmanuel Jemeni
- GitHub: @Jemeni11
- Twitter/X: @Jemeni11_