8000 feat(core): add component preview zoom controls by Norbiros · Pull Request #196 · romhml/compodium · GitHub
[go: up one dir, main page]

Skip to content

feat(core): add component preview zoom controls - #196

Open
Norbiros wants to merge 1 commit into
romhml:mainfrom
Norbiros:feat/zoom-controls
Open

Norbiros wants to merge 1 commit into
romhml:mainfrom
Norbiros:feat/zoom-controls

Conversation

@Norbiros
Copy link
Copy Markdown
Contributor

Resolves #11 (comment)

Screenshot From 2026-07-15 21-04-00

@pkg-pr-new
pkg-pr-new Bot commented Jul 15, 2026
Copy link
Copy Markdown
npm i https://pkg.pr.new/romhml/compodium/@compodium/core@196
npm i https://pkg.pr.new/romhml/compodium/@compodium/examples@196
npm i https://pkg.pr.new/romhml/compodium/@compodium/nuxt@196
npm i https://pkg.pr.new/romhml/compodium/@compodium/vue@196

commit: 69c9fe2


const { hooks } = useCompodiumClient()
const rendererMounted = ref(false)
const zoom = ref(1)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This zoom factor should also apply to the grid gap

      <RendererGrid
        v-if="showGrid"
        v-model:gap="scaledGridGap" <-- gridGap * zoom / 100 
      />

</RendererCombo>
</RendererWrapper>
</PreviewComponent>
<div :style="{ transform: `scale(${zoom})`, transformOrigin: 'center' }">
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this extra div? I feel like these styles can be applied to the one above

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's an overflow when zooming above 100%

Image

</div>

<div class="flex gap-2 justify-end">
<UInputNumber
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this to the left side of the preview, the right side feels a bit too crowded with it

@romhml
romhml force-pushed the main branch 2 times, most recently from d7ecffb to ef42a5e Compare August 26, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Roadmap / Ideas

2 participants

0