Originally posted by **davidjerleke** September 25, 2023
@tobimori we could **replace the number option** with a **callback** function like so:
```ts
const options = {
align: (viewSize, snapSize, index) => {
// create your own alignment
return yourCustomAlignment
}
}
```
The benefit of this would be that you would have direct access to the size of the container (viewSize) and the current slide/slideGroup (itemSize) which is convenient because you don't have to read element dimensions yourself. Note that the **function** would **run** for **each and every scroll snap**. This would be even more flexible than the previous implementation and wouldn't affect bundle size.
Feature request is related to
Describe the solution you'd like (discussed in https://github.com/davidjerleke/embla-carousel/discussions/579)
```ts const options = { align: (viewSize, snapSize, index) => { // create your own alignment return yourCustomAlignment } } ``` The benefit of this would be that you would have direct access to the size of the container (viewSize) and the current slide/slideGroup (itemSize) which is convenient because you don't have to read element dimensions yourself. Note that the **function** would **run** for **each and every scroll snap**. This would be even more flexible than the previous implementation and wouldn't affect bundle size.