This custom spin box shows basic support for optional units ("px", "em", etc.). This doesn't try to restrict which units are specified (although that could be added); it simply preserves the units when you increment or decrement the value.